package workspace;

public class test42 {
    /**
     * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
     *
     * 实现找零方法总数输出
     * @param N int整型 找零金额
     * @return int整型
     */
    int[] money = {10,5,2,1};
    int tar;
    int res = 0;
    public int GiveChargeSum (int N) {
        // write code here
        tar = N;
        dfs(N,0);
        return res;
    }

    public void dfs(int num,int begin){
        if(num == 0){
            res++;
            return;
        }else if(num < 0){
            return;
        }
        for(int i = begin ; i < 4 ; i++){
            if(num>=money[i]){
                dfs(num - money[i],i);
            }
        }
    }

    public static void main(String[] args) {
        test42 test42 = new test42();
        test42.GiveChargeSum(37);
        System.out.println(test42.res);

    }

}
